<template>
	<view>
		<view class="navi-bar">
			<view class="navi-back" @click="goBack">
				<
			</view>
			<view class="navi-title">
				日签
			</view>
		</view>
		<u-gap height="100" bgColor="#fff"></u-gap>
		<view class="dai-list">
			<view class="dai-item" @click="naviTo(d.hp_makettime.slice(0, 10))" v-for="(d, i) in UserCollectDailyList" :key="d.hpcontent_id">
				<view class="dai-image">
					<image :src="d.hp_img_url" mode="widthFix"></image>
					<view class="ima-vol">
						{{d.hp_title}}
					</view>
					<view class="ima-date">
						{{d.maketime.slice(0, 10)}}
					</view>
				</view>
				<view class="dai-text">
					{{d.hp_content}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		http
	} from '../../untils/http.js'
	
	const url = 'othercollection/8878093/more/0/0'
	
	export default {
		data() {
			return {
				UserCollectDailyList: []
			}
		},
		created() {
			http(url).then(res => {
				this.UserCollectDailyList = res.data
				console.log(this.UserCollectDailyList);
			})
		},
		methods: {
			naviTo(date) {
				uni.navigateTo({
					url: '../DailyContent/DailyContent?date=' + date
				})
			},
			goBack() {
				// 返回上一级并刷新当前页面
				this.$router.go(-1)
			}
		}
	}
</script>

<style lang="scss">
	* {
		box-sizing: border-box;
	}
	
	.navi-bar {
		position: fixed;
		width: 750rpx;
		height: 100rpx;
		line-height: 100rpx;
		z-index: 1000;
		background-color: #fff;
		font-weight: 600;
		
		.navi-back {
			margin-left: 15px;
			float: left;
		}
		
		.navi-title {
			margin-right: 28px;
			text-align: center;
		}
	}
	
	.dai-list {
		padding: 10px;
		width: 750rpx;
		column-count: 2;
		column-gap: 20rpx;
	}
	
	.dai-item {
		margin-bottom: 10px;
		width: 100%;
		height: 340rpx;
		background-color: #f5f5f5;
		box-shadow: 2px 2px 10px 1px #e2e2e2; 
		
		.dai-image {
			position: relative;
			width: 100%;
			height: 65%;
			overflow: hidden;
			
			image {
				width: 100%;
			}
			
			.ima-vol {
				padding: 2px 5px;
				position: absolute;
				left: 0;
				bottom: 0;
				font-size: 12px;
				color: #adadad;
			}
			
			.ima-date {
				padding: 2px 5px;
				position: absolute;
				right: 0;
				bottom: 0;
				font-size: 12px;
				color: #adadad;
			}
		}
		
		.dai-text {
			padding: 10px;
			font-size: 12px;
			color: #797979;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}
</style>
